package com.senbai.springlearning.contextlearn.controller;

import com.senbai.springlearning.contextlearn.bean.Person;
import com.senbai.springlearning.util.Md5Utils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

@Controller
@RequestMapping("/contextlearn")
public class ContextLearn {

    @RequestMapping(value = "/hello",method = RequestMethod.POST)
    public void sayHello(){
        System.out.println("hello there");
    }

//    @RequestMapping(value = "/active", method = RequestMethod.GET)
//    public void activePlugin(HttpServletRequest request, HttpServletResponse response){
//
//    }

    public static void main(String args[]){
        long time = new Date().getTime();
        System.out.println(time);
        Date now = new Date(time);
        System.out.println(now.toString());
        String a = "banutest_tzx_bill_level_up_abcd";
        System.out.println(Md5Utils.md5(a));
        List<Integer> idList = new ArrayList<>();
        idList.add(1);
        System.out.println(StringUtils.join(idList, ","));
        String s1 = new String("abcd");
        String s2 = "asdfghjkl";
        System.out.println(s1+", "+s2);
        change(s1,s2);
        System.out.println(s1+", "+s2);

    }

    static void change(String s1,String s2){
        s1 = "123456";
        s2 ="000000";
        System.out.println(s1+", "+s2);

    }
}
